define(function(require, exports, module){
	var cloudProjectTemp = require("text!../template/cloudProject.html");
	
	module.exports = Nuui.View.extend({
		
		template:cloudProjectTemp,

		onRender:function(){
			var view = this;
            App.request(App.server.getServePath(App.path.cloudlectureAction), {
                //data:"",
                success:function(data){
                    if(data.ec){
                        alert(data.em);
                    }else {
                        var cloudProjectList = data.cloudProjectList;

                        for(var i = 0; i < cloudProjectList.length; i++){
                            var tpl= '';
                            tpl='<li class="cloudProject-list" data-code="'+cloudProjectList[i].code+'">\n' +
                                '            <img src="../../../images/img/'+cloudProjectList[i].img+'" alt="">\n' +
                                '            <h4>'+cloudProjectList[i].title+'</h4>\n' +
                                '            <p><span>'+cloudProjectList[i].details+'</span><span>'+cloudProjectList[i].classify+'</span></p>\n' +
                                '        </li>'

                            view.$(".cloudProject").append(tpl);
                        }



                         $('.cloudProject').on('tap',"li", function(){
                             App.storage.set('project',$(this).attr('data-code'));
                             App.navigate("example/index/cloudProjectDetail",true);
                             return false;
                         });
                    }
                }
            });
        },
		
		onShow:function(){

		}
		
	});	
});